package com.bawei.rk_01.Adapter

import android.graphics.Color
import android.icu.text.Transliterator.Position
import android.widget.TextView
import com.bawei.base.utils.bean.CategoryEntityItem
import com.bawei.rk_01.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class OneAdapter : BaseQuickAdapter<CategoryEntityItem,BaseViewHolder>(R.layout.item_one) {
    var index = 515
    override fun convert(holder: BaseViewHolder, item: CategoryEntityItem) {
        holder.setText(R.id.one_tv,item.name)

        if (item.id == index){
            holder.getView<TextView>(R.id.one_tv).setTextColor(Color.RED)
        }else{
            holder.getView<TextView>(R.id.one_tv).setTextColor(Color.BLACK)
        }

    }

    fun IndexId(position: Int){
        index = position
        notifyDataSetChanged()
    }

}